public class s0126 {
    public static void main1(String[] args) {
//        int [] array = new int[3];//可以容纳3个int类型元素的数组
//        double [] array1 = new double[3];//可以容纳3个double类型元素的数组
//        String [] array2 = new String[3];//可以容纳3个字符串元素的数组
//        int [] array3 ;
//        array3 = new int[] {1,2,3};
//        int [] array5;
//        array5 = new int [3];
 /*  System.out.print(array[0]);
        System.out.print(array[1]);
        System.out.print(array[2]);
        System.out.print(array[3]);
        System.out.print(array[4]);
        System.out.print(array[5]);
        array[0]=7;
        System.out.print("   "+array[0]);
        System.out.print(array[1]);
        System.out.print(array[2]);
        System.out.print(array[3]);
        System.out.print(array[4]);
        System.out.print(array[5]);
         */

//        int[] array = {1, 2, 3, 4, 5, 6};
//        i =0 ;
//        for (i=0;i<5;i++) {
//            System.out.println(array[i]);
//        }
//      for (i=0;i<array.length;i++){
//          System.out.println(array[i]);
////        }
//        for (int i:array) {
//            System.out.println(i);
//        }
   }

    public static void main2(String[] args) {
      int i =0 ;
      int a = 0 ;
        int[] array =new int[3];
      array[0]=1;
      array[1]=2;
      array[2]=3;
      int [] array2=new int[]{1,2,3,4,5,6};
      array2[0]=50;
      array2[1]=100;
//    for (i=0;i<array.length;i++){
//        System.out.println(array[i]);
//    }

        array = array2;
        array2[3] = 300;
        array2[4] = 500;
        array2[5] = 600;
        for (a = 0; a < array2.length; a++) {
            System.out.println(array2[a]);
        }
    }

    public static void main(String[] args) {
        int[] a=null;
        System.out.println(a[0]);//报错练习
    }
}
